Step 5 - Create and use resources

In this step you learn how to use the Library window to create resources in your application.

Create resources in the Library window

In Kanzi a resource is an item you can reuse in different parts of your application. For example, a Mesh Data resource defines the geometry of a Model node and you can use the same Color Brush brush in different nodes to set the Foreground Brush or Background Brush properties.

You can find all resources in a Kanzi Studio project in the Library window.

You can find the Library window below the Project and Properties windows.

In this section you use the Library window to create a Color Brush. You use that brush to set the background of the Page nodes in your application.

To create and use resources in the Library window:

  1. In the Library window press Alt and right-click Materials and Textures, select Color Brush, and name it Black.
    Use a Color Brush to fill a 2D node with a solid color.
  2. In the Library window select the Color Brush you created and in the Properties window set the Brush Color property fields:
    TIP

    In Kanzi Studio you can apply color in hexadecimal format to all properties that set a color. In a tool that you use to set the color, copy the hexadecimal code of a color, in Kanzi Studio in the Properties right-click the color swatch of the property for which you want to use that color, and select Paste Color in Hex Format.

  3. In the Project window hold down the Ctrl key and click the Car and Media nodes to select them.
    TIP

    Select multiple nodes in the Project window and use the Properties window to apply the same property changes to all selected nodes.

  4. In the Properties window click next to the Background Brush property to add that property to all nodes you selected in the previous step and set the Background Brush property to the brush you created in the first step of this section.

In the Preview window click the Next and Previous buttons to navigate between the Page nodes to see how the Color Brush you created fills the background of the Car and Media nodes.


< PREVIOUS STEP
NEXT STEP >

See also

To learn more about the resources in Kanzi, see Resources.

To learn more about brushes, see Using brushes.